

******************************************************************
** Figure 5 : Relationship between deposit growth and invshare_sd 
******************************************************************

use "$datadir\ewallet\maindata.dta", clear
	
	label var c_deposit201604 "Change in deposit(2016 Q4-2016 Q3)"
	label var invshare_sd "Exposure"
	
	graph set window fontface "Garamond"
	keep if time_id == 35
	egen bin = xtile(invshare_sd), nq(50)
	collapse (mean) dep_ad_last_2years invshare_sd , by(bin)
	twoway (scatter dep_ad_last_2years invshare_sd, mcolor(gray) legend(off) graphregion(color(white)))  ///
	(lfit dep_ad_last_2years invshare_sd, lcolor(black)) , ///
	xscale(lcolor(none)) yscale(lcolor(none)) plotregion(lcolor(black)) ylabel(,nogrid)  xtitle("Exposure{subscript:d}")  ytitle("{&Delta} Bank Deposits{subscript:d}")  
	graph export "$outputdir_fig\Figure_5.pdf",   replace
	
